<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>推荐统计</title>
    <link rel="stylesheet" type="text/css" href="../../../css/aui/aui.css" />
    <style>
        html,
        body {
            background: #fff;
        }

        .tongji_wrap {
            height: 5rem;
            background: linear-gradient(to right, #01A2FF, #3285FF);
            text-align: center;
            color: #fff;
            line-height: 1.7rem;
            padding-top: 1rem;
        }

        .row_flex {
            display: flex;
            align-items: center;
            justify-content: space-between;
            ;
        }

        .list_item {
            border: 1px solid #eee;
            box-shadow: 0px 0px 4px #eee;
            border-radius: 0.2rem;
            padding: 0.3rem 0.7rem;
            margin-top: 0.7rem;
        }

        .fengexian {
            width: 1px;
            height: 3rem;
            background: rgba(255, 255, 255, 0.2);
        }

        .media_head {
            border-left: 0.3rem solid #0689FB;
            padding-left: 0.3rem;
            font-size: 0.9rem;
        }

        .touxiang {
            width: 2rem;
            margin-right: 0.5rem;
            border:1px solid #eee;
            border-radius: 50%;
            overflow: hidden;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="tongji_wrap row_flex">
            <div style="width:50%;">
                <div style="font-size:1rem;">{{info.money}}</div>
                <div>累计收入（元）</div>
            </div>
            <div class="fengexian"></div>
            <div style="width:50%;">
                <div style="font-size:1rem;">{{info.total}}</div>
                <div>累计推荐</div>
            </div>
        </div>

        <div class="aui-content-padded">
            <div class="media_head">推荐明细</div>
            <div class="list_wrap">

                <div class="list_item row_flex" v-for="o in list">
                    <div class='row_flex'>
                        <div class="touxiang"><img :src="o.headimgurl" onerror='this.src="../../../image/icon/menu03.png"' alt=""></div>
                        <div>{{o.user_name}}</div>
                    </div>
                    <div style="font-size:0.6rem;">
                        <div>状态：<span v-if="o.is_auth">已认证</span><span v-else>未认证</span></div>
                        <div>已获奖励：{{o.referees_price}}</div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</body>
<script src="../../../script/api.js" charset="utf-8"></script>
<script src="../../../script/aui/aui-tab.js" charset="utf-8"></script>
<script src="../../../script/common/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="../../../script/common/common.js" charset="utf-8"></script>
<script src="../../../script/common/config.js" charset="utf-8"></script>
<script src="../../../script/common/vue.min.js" charset="utf-8"></script>
<script>
    apiready = function() {
        api.parseTapmode();
        vm.init();
    }

    var vm = new Vue({
        el: "#app",
        data: {
            list: [],
            info: {},
        },
        methods: {
            init() {

                this.getDataInfo();
            },
            getDataInfo() {
                var that = this;
                var userInfo = get_local('userInfo');
                var data = {
                    user_id: userInfo.user_id
                };
                //获取推荐数量
                _ajax(Config.api.UserRefereesGetTotalAndMoney, data, function(ret) {
                    if (ret.code === 200) {
                        that.info = ret.data;
                    }
                });
                //获取推荐用户列表
                _ajax(Config.api.UserRefereesGetLists, data, function(ret) {
                    if (ret.code === 200) {
                        that.list = ret.data;
                    }
                });
            }
        }
    });
</script>

</html>
